#include "GMCreateNetworkedActor.h"
#include "Engine.h"
#include "GameState.h"

void GMCreateNetworkedActor::WriteToSckMsg( Networking::SockMsg* sm )
{
	sm->WriteInt(m_whichModel);
    sm->WriteInt(m_networkActorID);
}

bool GMCreateNetworkedActor::Execute()
{
	Engine::Instance()->GetCurrentState()->CreateNetworkedActor(m_whichModel, false, m_networkActorID); //ONLY executed on the client
	return true;
}

bool GMCreateNetworkedActor::ReadFromSckMsg( Networking::SockMsg* sm )
{
    if(!sm->ReadInt(&m_whichModel))
        return false;
    if(!sm->ReadInt(&m_networkActorID))
        return false;
    return true;
}
